﻿#include <iostream>
#include<map>
#include<vector>
#include<algorithm>
using namespace std;
struct kvCompare
{
    bool operator()(const pair<string, int>& p1, const pair<string, int>& p2)
    {
        return p1.second > p2.second;
    }
};

int main() {
    string str;
    getline(cin, str);
    map<string, int> countmap;
    string ret;
    for (int i = 0; i < str.size(); i++)
    {
        char ch = str[i];
        if (ch == ' ' || ch == '.')
        {
            countmap[ret]++;
            ret.clear();
        }
        else {
            ret += tolower(ch);
        }
    }
    vector<pair<string, int>> v(countmap.begin(), countmap.end());
    stable_sort(v.begin(), v.end(), kvCompare());
    for (auto e : v)
    {
        cout << e.first << ':' << e.second << endl;
    }

}
// 64 位输出请用 printf("%lld")